﻿using mozhi.smarterp.Business.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Volo.Abp.Application.Dtos;

namespace mozhi.smarterp.Business.Purchases.Requisition
{
    public class PurchaseRequisitionUpdateDto : EntityDto<Guid>
    {
        public Guid? DepartmentId { get; set; }

        [Required]
        public DateTime Date { get; set; }

        public string Comment { get; set; }

        /// <summary>
        /// 产品类型
        /// </summary>
        [Required]
        public ProductType ProductType { get; set; }

        [Required]
        public Guid CurrencyId { get; set; }

        public decimal ExchangeRate {  get; set; }


        public bool IncludeTax { get; set; }

        /// <summary>
        /// 申请人
        /// </summary>
        public Guid? ApplicantId { get; set; }


        public List<PurchaseRequisitionItemUpdateDto> Items { get; set; }
    }

    public class PurchaseRequisitionItemUpdateDto : EntityDto<Guid?>
    {
        [Required]
        public Guid ProductId { get; set; }

        /// <summary>
        /// 申请单位
        /// </summary>
        [Required]
        public Guid RequisitionUnitId { get; set; }

        /// <summary>
        /// 申请数量
        /// </summary>
        [Required]
        public decimal RequisitionQuantity { get; set; }


        /// <summary>
        ///要货日期
        /// </summary>
        public DateTime? RequiredDate { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal? Price { get; set; }


        public Guid? TaxRateId { get; set; }

        /// <summary>
        /// 建议供应商
        /// </summary>
        public Guid? SuggestedSupplierId { get; set; }

        public decimal? ApprovedQuantity { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }
}
